package com.noahplat.user.mapper;

import com.noahplat.user.pojo.Role;
import com.noahplat.user.pojo.RolePermission;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Set;

/**
 * 权限关系映射
 *
 * @author 李东
 * @version 1.0.0
 * @Date: 2021/2/27 9:02
 **/
public interface RolePermissionMapper extends Mapper<RolePermission> {
    @Insert("<script> INSERT INTO tb_role_permission(acctid,rid,pid) VALUES <foreach collection = 'pid' item='record' separator=','>" +
            "(#{acctid},#{rid},#{record})</foreach></script>")
    int insertRolePermission(@Param("acctid") Long acctid, @Param("rid") Long rid, @Param("pid") Set<Long> pid);
}
